<%@ page pageEncoding="UTF-8"%>
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.6.0/pure-min.css" />
<style>
#menuControll {
width: 96%;
position: relative;
word-wrap: break-word;
margin: 0;
padding: 2%;
background-color: #e0e0e0;
border-radius: 8px 8px 0 0;
}
.dtree {
padding: 2%;
}
</style>
<script type="text/javascript">
	var dtreeIconBasePath = "components/dtree";
	var treeMenu = [ {
			level : 1,
			name : "人力资源部"
		}, {
			level : 2,
			name : "部门管理",
			ico : "images/icon_default.gif",
			link : "department/Department_queryBP.action"
		}, {
			level : 2,
			name : "员工管理",
			ico : "images/icon_default.gif",
			link : "employee/Employee_queryBP.action"
		} ];
</script>
<script type="text/javascript" src="js/dtree.js"></script>
<div id="menuControll">
	<a href="#" onclick="tree.openAll();this.blur();return false;" class="pure-button pure-button-primary">展开</a>
	<a href="#" onclick="tree.closeAll();this.blur();return false;" class="pure-button pure-button-primary">折叠</a>
</div>
<div>
	<script type="text/javascript">
		tree = new dTree('tree');
		tree.config.target = "mainFrame";
		tree.config.useCookies = false;
		var selNum = -1;
		var link = "";

		tree.add(0, -1, '管理中心', null, null, null, '', '');
		var count = 0;
		var pLevelIdArray = new Array();
		pLevelIdArray[1] = 0;
		var currLevel = 1;
		for (var i = 0; i < treeMenu.length; i++) {
			var item = treeMenu[i];
			var itemLevel = item.level;
			pLevelIdArray[itemLevel + 1] = ++count;
			if (item.link != null && item.link != "") {
				if (item.ico != null) {
					tree.add(count, pLevelIdArray[itemLevel], item.name,
							item.link, null, null, item.ico, item.ico);
				} else {
					tree.add(count, pLevelIdArray[itemLevel], item.name,
							item.link);
				}
			} else {
				if (item.ico != null) {
					tree.add(count, pLevelIdArray[itemLevel], item.name,
							null, null, null, item.ico, item.ico);
				} else {
					tree.add(count, pLevelIdArray[itemLevel], item.name);
				}
			}
			if (item.select) {
				selNum = count;
				link = item.link;
			}
		}
		document.write(tree);
		tree.openAll();
		if (selNum != -1) {
			tree.openTo(selNum, true);
			top.document.frames[0].location.href = link;
		}
	</script>
</div>